package com.moyu.user.mapper.permission;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moyu.user.domain.permission.Permission;
import com.moyu.user.domain.permission.dto.PermissionQueryDTO;
import com.moyu.user.domain.permission.vo.PermissionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 权限数据层
 *
 * @Author 赵彦博
 * @Date 2024/12/27 15:27
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    int addPermissionWithRole(@Param("roleId") Long roleId,@Param("permissions") List<PermissionVO> permissions);

    List<PermissionVO> selectPermissionList(PermissionQueryDTO permissionQueryDTO);

    List<PermissionVO> selectPermissionListByRoleId(PermissionQueryDTO permissionQueryDTO);

    List<PermissionVO> selectPermissionListByRoleIdAll(Long id);

    int deleteAllById(Long id);

    List<Long> selectRoleAndPermission(Long id);
}
